// import Vue from 'vue'
// import VueRouter from 'vue-router'
// Vue.use(VueRouter);

// export default new VueRouter({
//     routes:[
//         {
//             path:"/home",
//             component:Home
//         },
//         {
//             path:"/demo",
//             component:Demo
//         }
//     ]
// })

import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/pages/Home/index.vue'
// import CarFriends from '@/pages/CarFriends/index.vue'
// import ChooseCar from '@/pages/ChooseCar/index.vue'
// import UsedCar from '@/pages/UsedCar/index.vue'
// import Service from '@/pages/Service/index.vue'
// import Search from '@/pages/Search/index.vue'
// import Demo from '@/pages/Demo/index.vue'
// import Recommend from '@/pages/Home/Recommend/index.vue'
// import Local from '@/pages/Home/Local/index.vue'
const routerHistory = createWebHistory()


const routes = [
    {
        path: "/",
        component: Home,
        meta: {
            isShow: true
        }
    },
    {
        path: "/home",
        component: Home,
        meta: {
            isShow: true
        },
        children: [

            { path: "recommend", component: () => import('@/pages/Home/Recommend/index.vue') },
            { path: "local", component: () => import('@/pages/Home/Local/index.vue') },
            { path: "demo", component: () => import('@/pages/Home/Demo/index.vue') }


        ]
    },
    {
        path: "/carFriends",
        component: () => import('@/pages/CarFriends/index.vue'),
        meta: {
            isShow: true
        }
    },
    {
        path: "/chooseCar",
        component: () => import('@/pages/ChooseCar/index.vue'),
        meta: {
            isShow: true
        }
    },
    {
        path: "/usedCar",
        component: () => import('@/pages/UsedCar/index.vue'),
        meta: {
            isShow: true
        }
    },
    {
        path: "/service",
        component: () => import('@/pages/Service/index.vue'),
        meta: {
            isShow: true
        }
    },

    {
        path: "/search",
        component: () => import('@/pages/Search/index.vue'),
        meta: {
            isShow: false
        },
        name: "search"
    },
    {
        path: "/searchDetail/:id",
        component: () => import('@/pages/SearchDetail/index.vue'),
        meta: {
            isShow: false
        },
        name: "searchDetail"
    },
    {
        path: "/demo",
        component: () => import('@/pages/Demo/index.vue'),
        meta: {
            isShow: false
        },
        name: "demo"
    },

]
const router = createRouter({
    history: routerHistory,
    routes
})

export default router